<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>编辑记录</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div class="container mt-5">
        <h2>编辑记录 - {{ record.name }}</h2>
        
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                {% for category, message in messages %}
                    <div class="alert alert-{{ category }}">{{ message }}</div>
                {% endfor %}
            {% endif %}
        {% endwith %}
        
        <form method="POST">
            <div class="mb-3">
                <label class="form-label">名称</label>
                <input type="text" class="form-control" name="name" value="{{ record.name }}" required>
            </div>
            <div class="mb-3">
                <label class="form-label">元宝</label>
                <input type="number" class="form-control" name="yuanbao" value="{{ record.yuanbao }}">
            </div>
            <div class="mb-3">
                <label class="form-label">金币</label>
                <input type="number" class="form-control" name="jinbi" value="{{ record.jinbi }}">
            </div>
            <div class="mb-3">
                <label class="form-label">备注</label>
                <textarea class="form-control" name="beizhu" rows="3">{{ record.beizhu }}</textarea>
            </div>
            <button type="submit" class="btn btn-primary">保存修改</button>
            <a href="{{ url_for('detail', name=record.name) }}" class="btn btn-secondary">取消</a>
        </form>
    </div>
</body>
</html>